package com.example.weather.utils.Tree;

import java.util.ArrayList;
import java.util.List;

public class Menu implements TreeNode<Long,Menu> {
    private Long id;
    private Long parentId;
    private String name;
    private List<Menu> children = new ArrayList<>();

    // 构造方法、getter和setter
    public Menu(Long id, Long parentId, String name) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
    }

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public Long getParentId() {
        return parentId;
    }

    @Override
    public void setChildren(List<Menu> children) {
        this.children = (List<Menu>) children;
    }


    @Override
    public List<Menu> getChildren() {
        return children;
    }


    // 其他getter和setter
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}